// 引入LeanCloud存储
var AV = require('leancloud-storage');

// 商品模型
class Goods extends AV.Object{
    // 标题
    get name(){
        return this.get('name')
    }
    set name(value){
        this.set('name',value)
    }

    // 描述
    get desc(){
        return this.get('desc')
    }
    set desc(value){
        this.set('desc',value)
    }

    // 缩略图
    get thumbImg(){
        return this.get('thumbImg')
    }
    set thumbImg(value){
        this.set('thumbImg',value)
    }

    // 详情图片
    get imageList(){
        return this.get('imageList')
    }
    set imageList(value){
        this.set('imageList',value)
    }

    // 规格
    get specList(){
        return this.get('specList')
    }
    set specList(value){
        this.set('specList',value)
    }

    // 分组
    get groups(){
        return this.get('groups')
    }
    set groups(value){
        this.set('groups',value)
    }

    // 属性
    get properties(){
        return this.get('properties')
    }
    set properties(value){
        this.set('properties',value)
    }

    // 价格 
    get price(){
        return this.get('price')
    }
    set price(value){
        this.set('price',value)
    }

    /** nGoods.price = this.from.price
                nGoods.mealfee = this.from.mealfee
                nGoods.inventoryType = this.from.inventoryType
                nGoods.inventoryNumber = this.from.inventoryNumber */

    //餐盒费
    get mealfee(){
        return this.get('mealfee')
    }
    set mealfee(value){
        this.set('mealfee',value)
    }
    
    //库存方式
    get inventoryType(){
        return this.get('inventoryType')
    }
    set inventoryType(value){
        this.set('inventoryType',value)
    }

    //库存量
    get inventoryNumber(){
        return this.get('inventoryNumber')
    }
    set inventoryNumber(value){
        this.set('inventoryNumber',value)
    }

    //保存对应的对铺
    get shopId(){
        return this.get('shopId')
    }
    set shopId(value){
        this.set('shopId',value)
    }

}
AV.Object.register(Goods, 'Goods');
export default Goods